package com.yaolaizaixian.merchant.utils;

import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;

/**
 * Created by ylzx on 2016/9/23.
 * 隐藏软键盘
 */
public class InputMethodUtils {

    public static void InputMethodManager(TextView v){

        //隐藏软键盘
        InputMethodManager imm = (InputMethodManager) v
                .getContext().getSystemService(
                        Context.INPUT_METHOD_SERVICE);
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(
                    v.getApplicationWindowToken(), 0);
        }
    }
}
